﻿using System;
using System.Collections.Generic;
using System.Text;
using Ecreate.Data;
using Ecreate.Model;
using System.Collections;
namespace Ecreate.Business
{
    public class OrderService
    {
        public void Insert(Order model)
        {
            FactoryDBEngine.getIBatisService().Insert("t_order_Insert", model);
        }

        public void Check(Order model)
        {
            FactoryDBEngine.getIBatisService().Update("t_order_Update", model);
        }

        public IList SelectAll()
        {
            IList model = ExecuteQueryForList("t_order_SelectAll", null);
            return model;
        }

        public IList SelectByID(string orderid)
        {
            IList model = ExecuteQueryForList("t_order_SelectByID", orderid);
            return model;
        }

        public IList SelectBySellPhoneNumber(string sellphonenumber)
        {
            IList model = ExecuteQueryForList("t_order_SelectBySellPhoneNumber", sellphonenumber);
            return model;
        }

        public IList SelectCurrentDayOrderByID()
        {
            IList model = ExecuteQueryForList("t_order_SelectCurrentDayOrderByID", null);
            return model;
        }

        public IList SelectCurrentDayOrderByTimes()
        {
            IList model = ExecuteQueryForList("t_order_SelectCurrentDayOrderByTimes", null);
            return model;
        }

        public IList SelectAllUnCheckedOrder()
        {
            IList model = ExecuteQueryForList("t_order_SelectAllUnCheckedOrder", null);
            return model;
        }

        public IList SelectByProductClass1(string class1)
        {
            IList model = ExecuteQueryForList("t_order_SelectByProductClass1", class1);
            return model;
        }

        public IList ExecuteQueryForList(string statementName, object parameterObject)
        {
            return FactoryDBEngine.getIBatisService().ExecuteQueryForList(statementName, parameterObject);
        }
    }
}
